﻿using System;
using BP.DA;
using BP.En;
using NPOI.SS.Formula.Functions;

namespace BP.WF.CCFast.Third.GoView
{
    /// <summary>
    /// 操作员 属性
    /// </summary>
    public class GoviewProjectAttr : BP.En.EntityNoNameAttr
    {
        /** 
	     项目名称
	    */
        public const string OID = "OID";
        /** 
	     项目名称
	    */
        public const string ProjectName = "ProjectName";
        /** 
	     状态
	    */
        public const string State = "State";
        /** 
	     创建时间
	    */
        public const string CreateTime = "CreateTime";
        /** 
	     创建用户ID
	    */
        public const string CreateUserId = "CreateUserId";
        /** 
	     是否删除
	    */
        public const string isDelete = "isDelete";
        /** 
	     备注
	    */
        public const string Remarks = "Remarks";
        /** 
	     图片索引
	    */
        public const string indexImage = "indexImage";
        /** 
	     是否模板
	    */
        public const string isTemplate = "isTemplate";
    }
    /// <summary>
    /// 操作员 的摘要说明。
    /// </summary>
    public class GoviewProject : EntityMyPK
    {
        #region 扩展属性

        public string ProjectName
        {
            get
            {
                return this.GetValStrByKey(GoviewProjectAttr.ProjectName);
            }
            set
            {
                this.SetValByKey(GoviewProjectAttr.ProjectName, value);
            }
        }
        public int State
        {
            get
            {
                return this.GetValIntByKey(GoviewProjectAttr.State);
            }
            set
            {
                this.SetValByKey(GoviewProjectAttr.State, value);
            }
        }
        public string CreateTime
        {
            get
            {
                return this.GetValStrByKey(GoviewProjectAttr.CreateTime);
            }
            set
            {
                this.SetValByKey(GoviewProjectAttr.CreateTime, value);
            }
        }

        public string CreateUserId
        {
            get
            {
                return this.GetValStrByKey(GoviewProjectAttr.CreateUserId);
            }
            set
            {
                this.SetValByKey(GoviewProjectAttr.CreateUserId, value);
            }
        }

        public int isDelete
        {
            get
            {
                return this.GetValIntByKey(GoviewProjectAttr.isDelete);
            }
            set
            {
                this.SetValByKey(GoviewProjectAttr.isDelete, value);
            }
        }

        public string Remarks
        {

            get
            {
                return this.GetValStrByKey(GoviewProjectAttr.Remarks);
            }
            set
            {
                this.SetValByKey(GoviewProjectAttr.Remarks, value);
            }
        }

        public string indexImage
        {
            get
            {
                return this.GetValStrByKey(GoviewProjectAttr.indexImage);
            }
            set
            {
                this.SetValByKey(GoviewProjectAttr.indexImage, value);
            }
        }

        public int isTemplate
        {
            get
            {
                return this.GetValIntByKey(GoviewProjectAttr.isTemplate);
            }
            set
            {
                this.SetValByKey(GoviewProjectAttr.isTemplate, value);
            }
        }

        #endregion

        #region 构造函数

        public GoviewProject()
        {
        }
        /** 
	     登录记录
	    */
        public override UAC HisUAC
        {
            get
            {
                UAC uac = new UAC();
                uac.OpenForSysAdmin();
                return uac;
            }
        }
        /** 
	    登录记录
	     @param pkval
	    */
        public GoviewProject(string pkval) : base(pkval) { }

        /// <summary>
        /// 重写基类方法
        /// </summary>
        public override Map EnMap
        {
            get
            {
                if (this._enMap != null)
                    return this._enMap;

                Map map = new Map("goview_projects", "goview项目信息");
                map.setCodeStruct("2");

                //map.AddTBIntPKOID();
                //map.add
                map.AddMyPK();
                //map.AddTBStringPK(GoviewProjectAttr.OID, null, "OID", true, false, 0, 100, 20);
                map.AddTBString(GoviewProjectAttr.ProjectName, null, "项目名称", true, false, 0, 100, 20);
                //		map.AddTBString(GoviewProjectAttr.State, null, "项目状态", true, false, 0, 100, 20);
                map.AddTBInt(GoviewProjectAttr.State, 0, "项目状态", true, false);

                map.AddTBString(GoviewProjectAttr.CreateTime, null, "创建时间", true, false, 0, 100, 20);
                map.AddTBString(GoviewProjectAttr.CreateUserId, null, "创建用户ID", true, false, 0, 100, 20);

                //		map.AddTBString(GoviewProjectAttr.isDelete, null, "是否删除", true, false, 0, 100, 20);
                map.AddTBInt(GoviewProjectAttr.isDelete, 0, "是否删除", true, false);
                map.AddTBString(GoviewProjectAttr.Remarks, null, "备注", true, false, 0, 100, 20);

                map.AddTBDateTime(GoviewProjectAttr.indexImage, null, "图片索引", true, false);
                map.AddTBInt(GoviewProjectAttr.isTemplate, 0, "是否模板", true, false);

                this._enMap = map;
                return this._enMap;
            }
        }



        /// <summary>
        /// 获取集合
        /// </summary>
        public override Entities GetNewEntities
        {
            get { return new GoviewProjects(); }
        }
        #endregion 构造函数
    }

    public class GoviewProjects : EntitiesMyPK
    {
        #region 构造方法
        /// <summary>
        /// 得到它的 Entity 
        /// </summary>
        public override Entity GetNewEntity
        {
            get
            {
                return new GoviewProject();
            }
        }
        /// <summary>
        /// 操作员s
        /// </summary>
        public GoviewProjects()
        {
        }

        #endregion 构造方法

        #region 为了适应自动翻译成java的需要,把实体转换成List.
        /// <summary>
        /// 转化成 java list,C#不能调用.
        /// </summary>
        /// <returns>List</returns>
        public System.Collections.Generic.IList<GoviewProject> ToJavaList()
        {
            return (System.Collections.Generic.IList<GoviewProject>)this;
        }
        /// <summary>
        /// 转化成list
        /// </summary>
        /// <returns>List</returns>
        public System.Collections.Generic.List<GoviewProject> Tolist()
        {
            System.Collections.Generic.List<GoviewProject> list = new System.Collections.Generic.List<GoviewProject>();
            for (int i = 0; i < this.Count; i++)
            {
                list.Add((GoviewProject)this[i]);
            }
            return list;
        }
        #endregion 为了适应自动翻译成java的需要,把实体转换成List.
    }
}
